<template>
	<view>
		<view class="title-wrap">
			<view class="left">
				<image v-if="img" class="img" :src="img" mode="scaleToFill"></image>
				<text v-if="title" class="txt">{{title}}</text>
			</view>
			<view class="right">
				<view @click="handleClick">
					<text>{{tip}}</text>
					<u-icon v-if="arrow" name="arrow-right"></u-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			img:{
				type: String,
				default: ''
			},
			title: {
				type: String,
				default: '标题'
			},
			tip:{
				type: String,
				default: '更多'
			},
			arrow:{
				type: Boolean,
				default: true
			}
		},
		methods:{
			handleClick(){
				this.$emit('handleClick')
			}
		}
	}
</script>

<style lang="scss" scoped>
.title-wrap{
	padding: 24rpx 12rpx;
	display: flex;
	justify-content: space-between;
	align-items: center;
	.left{
		.img{
			vertical-align: middle;
			width: 46rpx;
			height: 46rpx;
		}
		.txt{
			padding-left: 18rpx;
			font-size: 32rpx;
		}
	}
	.right{
		font-size: 28rpx;
		color: #909399;
	}
}
</style>